﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Com.Library.DB.Menu
{
	public class RecommendMenuModel
	{
		public static void Create(byte CategoryNo, string ImageURL, string Link, byte LinkType, string Desc, string ManagerName)
		{
			RecommendMenuCreateArguments arg = new RecommendMenuCreateArguments();
			arg.n1CategoryNo = CategoryNo;
			arg.strImageURL = ImageURL;
			arg.strLink = Link;
			arg.n1LinkType = LinkType;
			arg.strDescription = Desc;
			arg.strManagerName = ManagerName;

			RecommendMenuCreate sp = new RecommendMenuCreate();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static void Remove(int SeqNo)
		{
			RecommendMenuRemoveArguments arg = new RecommendMenuRemoveArguments();
			arg.n4SeqNo = SeqNo;

			RecommendMenuRemove sp = new RecommendMenuRemove();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static void Modify(int SeqNo, string ImageURL, string Link, byte LinkType, string Desc, string ManagerName)
		{
			RecommendMenuModifyArguments arg = new RecommendMenuModifyArguments();
			arg.n4SeqNo = SeqNo;
			arg.strImageURL = ImageURL;
			arg.strLink = Link;
			arg.n1LinkType = LinkType;
			arg.strDescription = Desc;
			arg.strManagerName = ManagerName;

			RecommendMenuModify sp = new RecommendMenuModify();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static List<RecommendMenuEntity> GetList(byte CategoryNo, int PageNo, byte PageSize)
		{
			RecommendMenuGetListArguments arg = new RecommendMenuGetListArguments();
			arg.n1CategoryNo = CategoryNo;
			arg.PageNo = PageNo;
			arg.PageSize = PageSize;

			RecommendMenuGetList sp = new RecommendMenuGetList();
			sp.SetArguments(arg);
			List<RecommendMenuEntity> ListData = sp.Execute();

			return ListData;
		}
	}
}
